import requests

if __name__ == '__main__':

    # 接口是否通过
    resp = requests.get("http://www.baidu.com",timeout=1)
    print(resp.status_code)
    print(resp.headers)
    print(resp.text)